<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:t="http://myfaces.apache.org/tomahawk"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">
<h:head>
<ui:include src="../templates/subhead.xhtml" />
</h:head>
<h:body styleClass="iframebody">
	<f:loadBundle basename="us.gaaoc.framework.webapp.util.userMessage"
				var="bundle" />
				<t:div id="search" styleClass="search">
				<table style="width:100%">
					<tr>
					<h:form id="uploadForm" method="POST">					
						<td>
								Case Status 
						</td>
				   		<td>
							<h:selectOneMenu id="caseStatus" size="1" value="#{allFilingsTablePage.caseStatus}" binding="#{allFilingsTablePage.caseStatusInput}" title="#{bundle.caseStatusInputText}">
								<f:selectItems id="selectItem" value="#{allFilingsTablePage.caseStatusItems}"  />
							</h:selectOneMenu>
						</td>
					
						<td>
							<label for="OCSSNumber">Ocss Number </label>
						</td>
						<td>
							<h:inputText id="OCSSNumber" value="#{allFilingsTablePage.externalCaseRecordNumber}" title="#{bundle.oCSSNumberInputText}"/> 
						</td>
						<td>
							<label for="docketId">Civil Action Number </label>
						</td>
						<td>
							<h:inputText id="docketId"	value="#{allFilingsTablePage.docketId}" title="#{bundle.civilActionNumberInputText}"/> 
						</td>
						<td>						
						<t:commandButton for="CivilActionNumber" value="View Case Filing"  title="#{bundle.civilActionNumberButton}">
					        <f:ajax event="click" execute="@form" render="dataform"/>
					    </t:commandButton>											
						</td>
					
					</h:form> 
					</tr>
					</table>
					
				</t:div>
			
		<h:form id="dataform">	
			<h:panelGrid columns="1" styleClass="outerTable"
				columnClasses="standardTable_ColumnCentered">
				<h:column>
					<center>					
						<t:dataTable	rowClasses="${allFilingsTablePage.rowClasses}" 
							renderedIfEmpty="false" id="courtSideReceivedTable"							
							value="#{allFilingsTablePage.data}" var="caseRecord"							
							styleClass="iCubed" width="100%" rows="10"							
							rowIndexVar="rowNumber" preserveSort="false"
							preserveDataModel="true" sortable="true"
							binding="#{allFilingsTablePage.dataTable}" varDetailToggler="detailToggler" ajaxRowRender="true">							
							
							<h:column rendered="#{allFilingsTablePage.hideCaseDetails}">
								<f:facet name="header">
									<h:outputText value="Case Details" />
								</f:facet>
								<t:div id="panel">
									 <t:commandLink  action="#{detailToggler.toggleDetail}" styleClass="showhide ui-icon ui-icon-circle-arrow-w">
									 		<h:outputText value="show" styleClass="ui-icon ui-icon-circle-arrow-w"/>
							              <f:ajax render="detailStampRow" onevent="myJsFunction"  listener="#{agentCaseDetailsPage.onCaseUuidChange(caseRecord.uuid)}"/><!-- panel detailStampRow -->
							          </t:commandLink>						          							
						        </t:div>
								
								<h:graphicImage url="/images/tag_selected.gif" onClick="javascript:toggleTag(this,'${caseRecord.uuid}');"
									rendered="${allFilingsTablePage.checkTag[caseRecord.uuid]}"/>

								<h:graphicImage url="/images/tag_white.gif" onClick="javascript:toggleTag(this,'${caseRecord.uuid}');"
									rendered="${allFilingsTablePage.checkTag[caseRecord.uuid]}"/>

							</h:column>
							<!-- <h:column>
								<f:facet name="header">
									<h:outputText value="Clear" />
								</f:facet>

								<h:commandLink value="Clear"
									rendered="#{caseRecord.status.code ==7 ||
						 					caseRecord.status.code ==8 || 
						 					caseRecord.status.code ==3 || 
						 					caseRecord.status.code ==10 || 
											caseRecord.status.code ==11 and 
						 					caseRecord.valid}"
									action="#{allFilingsTablePage.clearCase}" target="_parent">
									<f:param name="caseUuid" value="#{caseRecord.uuid}" />
								</h:commandLink>
							</h:column>-->

							<h:column>
								<f:facet name="header">
									<h:outputText value="OCSS Number" />
								</f:facet>
								<h:outputText value="#{caseRecord.filingNumber}"
									rendered="${caseRecord.valid}" />
							</h:column>

							<h:column>
								<f:facet name="header">
									<h:outputText value="Civil Action #" />
								</f:facet>
								<h:outputText value="#{caseRecord.caseTrackingId}"
									rendered="${caseRecord.valid}" />
							</h:column> 


							<h:column>
								<f:facet name="header">
									<h:commandLink
										action="${allFilingsTablePage.sortByInitiatedDate}">
										<h:outputText value="Initiated Date" />
									</h:commandLink>
								</f:facet>

								<h:outputText value="#{caseRecord.instantiationDateTime}"
									rendered="${caseRecord.valid}">
									<f:convertDateTime dateStyle="medium"
										timeZone="America/New_York" type="date" />
								</h:outputText>
							</h:column>
							<h:column>
								<f:facet name="header">
									<h:outputText id="defendantFirstName"
										value="Defendant First Name" />
								</f:facet>

								<h:outputText value="#{caseRecord.defendantFirstName}"
									rendered="${caseRecord.valid}" />
							</h:column>
							<h:column>
								<f:facet name="header">
									<h:outputText id="defendantLastName"
										value="Defendant Last Name" />
								</f:facet>

								<h:outputText value="#{caseRecord.defendantLastName}"
									rendered="${caseRecord.valid}" />
							</h:column>


							<h:column>
								<f:facet name="header">
									<h:outputText id="caseStatus" value="Case Status" />
								</f:facet>
								<h:outputText value="#{caseRecord.status.description}"
									rendered="${caseRecord.valid}" />

							</h:column>
							<!-- <h:column>
								<f:facet name="header">
									<h:outputText id="lastEvent" value="Last Event" />
								</f:facet>
								<h:commandLink id="filingIDLink" value="Event Log"
									rendered="${caseRecord.valid}"
									action="#{allFilingsTablePage.gotoHistoryPage}"
									target="_parent">
									<f:param name="caseUuid" value="#{caseRecord.uuid}" />
								</h:commandLink>
							</h:column>
							<h:column>
								<f:facet name="header">
									<h:commandLink action="${allFilingsTablePage.sortByMostRecent}">
										<h:outputText id="lastEventTime" value="Last Event Time" />
									</h:commandLink>
								</f:facet>
								<h:outputText value="#{caseRecord.lastEventTime}"
									rendered="${caseRecord.valid}">
									<f:convertDateTime dateStyle="medium"
										timeZone="America/New_York" type="date" />
								</h:outputText>
							</h:column> -->

							<!--   <h:dataTable value="#{detail.TableView}" var="o"> -->

							<h:column rendered="#{allFilingsTablePage.hideCaseDetails}" headerClass="actionhead">
								<f:facet name="header">
									<h:outputText id="filingID" value="Case Actions" />
								</f:facet>
									<h:commandLink title="#{bundle.sendToAttorney}" onclick="return confirm('Are you sure you want to send the case to the Attorney ?');" 
											rendered="#{caseRecord.status.code ==7 ||
						 					caseRecord.status.code ==15 || 
											caseRecord.status.code ==3 and 
						 					caseRecord.valid}">
										<h:outputText value="show" styleClass="ui-icon ui-icon-person"/>
										<f:ajax render="@form" listener="#{agentCaseDetailsPage.sendToAttorney(caseRecord.uuid)}"/><!-- panel detailStampRow -->	
									</h:commandLink>
									<h:commandLink title="#{bundle.sendToClerk}" onclick="return confirm('Are you sure you want to send the case to the clerk ?');"
									rendered="#{caseRecord.status.code ==7 ||
						 					caseRecord.status.code ==15 || 
											caseRecord.status.code ==3 and 
						 					caseRecord.valid}">
										<h:outputText value="show" styleClass="ui-icon ui-icon-mail-closed"/>
										<f:ajax render="@form" listener="#{agentCaseDetailsPage.sendToClerk(caseRecord.uuid)}"/><!-- panel detailStampRow -->	
									</h:commandLink>
									<h:commandLink title="#{bundle.clearCase}" rendered="#{caseRecord.status.code ==7 ||
						 					caseRecord.status.code ==8 || 
						 					caseRecord.status.code ==3 || 
						 					caseRecord.status.code ==10 || 
											caseRecord.status.code ==11 and 
						 					caseRecord.valid}" onclick="return confirm('Are you sure you want to delete the case ?');"
									><h:outputText value="show" styleClass="ui-icon ui-icon-trash"/>
									<f:ajax render="@form" listener="#{allFilingsTablePage.clearCase(caseRecord.uuid)}"/><!-- panel detailStampRow -->									
								</h:commandLink>						
							</h:column>
							 <f:facet name="detailStamp">							
								<ui:include src="childEnforcement/childEnforcementCaseDetailsPage.xhtml" />
						    </f:facet>

						</t:dataTable>						
					</center>
				</h:column>
				<h:column>
					<div align="center">
						<t:dataScroller fastStep="5" styleClass="scrollerTable"
							pageCountVar="pageCount" pageIndexVar="pageIndex"
							paginator="true" paginatorMaxPages="10"
							paginatorTableClass="paginator"
							skinRowClass=""
							paginatorActiveColumnClass="active" immediate="true"
							for="courtSideReceivedTable">
							<f:facet name="first">
								<h:outputText value="first" styleClass="ui-icon ui-icon-seek-first"/>
								<!-- <t:graphicImage url="/images/arrow-first.gif" border="1"
									styleClass="objectList_GraphicImage" /> -->
							</f:facet>
							<f:facet name="last">
								<h:outputText value="last" styleClass="ui-icon ui-icon-seek-end"/>
								<!-- <t:graphicImage url="/images/arrow-last.gif" border="1"
									styleClass="objectList_GraphicImage" /> -->
							</f:facet>
							<f:facet name="previous">
								<h:outputText value="previous" styleClass="ui-icon ui-icon-seek-first previous"/>
								<!-- <t:graphicImage url="/images/arrow-previous.gif" border="1"
									styleClass="objectList_GraphicImage" /> -->
							</f:facet>
							<f:facet name="next">
								<h:outputText value="next" styleClass="ui-icon ui-icon-seek-end next"/>
								<!-- <t:graphicImage url="/images/arrow-next.gif" border="1"
									styleClass="objectList_GraphicImage" /> -->
							</f:facet>
							<f:facet name="fastforward">
								<h:outputText value="fastforward" styleClass="ui-icon ui-icon-seek-next"/>
								<!-- <t:graphicImage url="/images/arrow-ff.gif" border="1"
									styleClass="objectList_GraphicImage" /> -->
							</f:facet>
							<f:facet name="fastrewind">
								<h:outputText value="fastrewind" styleClass="ui-icon ui-icon-seek-prev"/>
								<!-- <t:graphicImage url="/images/arrow-fr.gif" border="1"
									styleClass="objectList_GraphicImage" /> -->
							</f:facet>
						</t:dataScroller>
					</div>
				</h:column>
			</h:panelGrid>				
		</h:form>

</h:body>
</html>
